<html>
<head><meta charset="utf-8"><title>Recent breakage in recursive solver · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Recent.20breakage.20in.20recursive.20solver.html">Recent breakage in recursive solver</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="211511578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Recent%20breakage%20in%20recursive%20solver/near/211511578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Whitaker <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Recent.20breakage.20in.20recursive.20solver.html#211511578">(Sep 28 2020 at 15:56)</a>:</h4>
<p>Hey all, I was curious if the recursive solver fares any better in the rustc test suite so I tried switching it out and found a <em>bunch</em> of tests fail because of a failed assertion in <code>fold_free_var_ty</code>.  I then noticed that there's breakage in rust-analyzer as well. With the latest version of chalk that same assertion fails in rust-analyzer (seen <a href="https://github.com/rust-analyzer/rust-analyzer/runs/1176322865">here</a> in a failed CI run).</p>



<a name="211511721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Recent%20breakage%20in%20recursive%20solver/near/211511721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Whitaker <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Recent.20breakage.20in.20recursive.20solver.html#211511721">(Sep 28 2020 at 15:57)</a>:</h4>
<p>Bisection points to the recent auto traits changes, so I think we may have introduced a bug there</p>



<a name="211512077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Recent%20breakage%20in%20recursive%20solver/near/211512077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Recent.20breakage.20in.20recursive.20solver.html#211512077">(Sep 28 2020 at 16:00)</a>:</h4>
<p>Uh oh, no good</p>



<a name="211512835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Recent%20breakage%20in%20recursive%20solver/near/211512835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Recent.20breakage.20in.20recursive.20solver.html#211512835">(Sep 28 2020 at 16:06)</a>:</h4>
<p>I bet it's because we need to generalize the program clauses</p>



<a name="211512959"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Recent%20breakage%20in%20recursive%20solver/near/211512959" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Recent.20breakage.20in.20recursive.20solver.html#211512959">(Sep 28 2020 at 16:07)</a>:</h4>
<p>Probably here: <a href="https://github.com/rust-lang/chalk/pull/612/files#diff-a66f74f4c8a6a7a1342ab7c62c3ae8a4R314">https://github.com/rust-lang/chalk/pull/612/files#diff-a66f74f4c8a6a7a1342ab7c62c3ae8a4R314</a></p>



<a name="211513166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Recent%20breakage%20in%20recursive%20solver/near/211513166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Recent.20breakage.20in.20recursive.20solver.html#211513166">(Sep 28 2020 at 16:08)</a>:</h4>
<p>Can someone try testing with just that line commented out?</p>



<a name="211515794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Recent%20breakage%20in%20recursive%20solver/near/211515794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Recent.20breakage.20in.20recursive.20solver.html#211515794">(Sep 28 2020 at 16:30)</a>:</h4>
<p>rust-analyzer issue: <a href="https://github.com/rust-analyzer/rust-analyzer/issues/6078">https://github.com/rust-analyzer/rust-analyzer/issues/6078</a></p>



<a name="211516068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Recent%20breakage%20in%20recursive%20solver/near/211516068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Whitaker <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Recent.20breakage.20in.20recursive.20solver.html#211516068">(Sep 28 2020 at 16:32)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/Recent.20breakage.20in.20recursive.20solver/near/211513166">said</a>:</p>
<blockquote>
<p>Can someone try testing with just that line commented out?</p>
</blockquote>
<p>Unfortunately that doesn't fix it</p>



<a name="211521146"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Recent%20breakage%20in%20recursive%20solver/near/211521146" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Recent.20breakage.20in.20recursive.20solver.html#211521146">(Sep 28 2020 at 17:11)</a>:</h4>
<p><span class="user-mention silent" data-user-id="230601">Nathan Whitaker</span> <a href="#narrow/stream/144729-wg-traits/topic/Recent.20breakage.20in.20recursive.20solver/near/211516068">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/Recent.20breakage.20in.20recursive.20solver/near/211513166">said</a>:</p>
<blockquote>
<p>Can someone try testing with just that line commented out?</p>
</blockquote>
<p>Unfortunately that doesn't fix it</p>
</blockquote>
<p>Shoot</p>



<a name="211521241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Recent%20breakage%20in%20recursive%20solver/near/211521241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Recent.20breakage.20in.20recursive.20solver.html#211521241">(Sep 28 2020 at 17:12)</a>:</h4>
<p>Almost want to revert the PR for now. Seems pretty bad.</p>



<a name="211521924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Recent%20breakage%20in%20recursive%20solver/near/211521924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Recent.20breakage.20in.20recursive.20solver.html#211521924">(Sep 28 2020 at 17:16)</a>:</h4>
<p>Actually <a href="https://github.com/rust-lang/chalk/pull/612/files#diff-a66f74f4c8a6a7a1342ab7c62c3ae8a4R151">https://github.com/rust-lang/chalk/pull/612/files#diff-a66f74f4c8a6a7a1342ab7c62c3ae8a4R151</a> is also wrong</p>



<a name="211522514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Recent%20breakage%20in%20recursive%20solver/near/211522514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Recent.20breakage.20in.20recursive.20solver.html#211522514">(Sep 28 2020 at 17:21)</a>:</h4>
<p>This time, it's not the <em>trait</em> might have bound vars, but instead the type</p>



<a name="211523131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Recent%20breakage%20in%20recursive%20solver/near/211523131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Recent.20breakage.20in.20recursive.20solver.html#211523131">(Sep 28 2020 at 17:26)</a>:</h4>
<p>So, <a href="https://github.com/rust-lang/chalk/blob/a6d2e439f7e4f9bc9a567d7c394b6dc048a1b8bb/chalk-solve/src/clauses.rs#L302">here</a> we probably want to wrap this in a </p>
<div class="codehilite"><pre><span></span><code>let generalized = generalize::Generalize::apply(db.interner(), trait_ref);
builder.push_binders(&amp;generalized, |builder, trait_ref| {
...
})
</code></pre></div>



<a name="211523265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Recent%20breakage%20in%20recursive%20solver/near/211523265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Recent.20breakage.20in.20recursive.20solver.html#211523265">(Sep 28 2020 at 17:27)</a>:</h4>
<p>Unfortunately, I don't have the time today to test this</p>



<a name="211523460"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Recent%20breakage%20in%20recursive%20solver/near/211523460" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Recent.20breakage.20in.20recursive.20solver.html#211523460">(Sep 28 2020 at 17:29)</a>:</h4>
<p>If this does fix the issue, I would like to get it out ASAP. But definitely at least for a followup issue, I'd like to get a repro test to make sure this doesn't happen in the future.</p>



<a name="211526743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Recent%20breakage%20in%20recursive%20solver/near/211526743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Whitaker <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Recent.20breakage.20in.20recursive.20solver.html#211526743">(Sep 28 2020 at 17:56)</a>:</h4>
<p>That does indeed fix it <span aria-label="congratulations" class="emoji emoji-1f389" role="img" title="congratulations">:congratulations:</span></p>



<a name="211526761"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Recent%20breakage%20in%20recursive%20solver/near/211526761" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Whitaker <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Recent.20breakage.20in.20recursive.20solver.html#211526761">(Sep 28 2020 at 17:56)</a>:</h4>
<p><a href="https://github.com/rust-lang/chalk/pull/613">PR here</a></p>



<a name="211526875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Recent%20breakage%20in%20recursive%20solver/near/211526875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Whitaker <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Recent.20breakage.20in.20recursive.20solver.html#211526875">(Sep 28 2020 at 17:57)</a>:</h4>
<p><a href="https://github.com/rust-lang/chalk/issues/614">Follow-up issue</a> for repro test</p>



<a name="211527250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Recent%20breakage%20in%20recursive%20solver/near/211527250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Recent.20breakage.20in.20recursive.20solver.html#211527250">(Sep 28 2020 at 18:00)</a>:</h4>
<p>approved, see comment</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>